﻿<%@ Page Language="C#" Title="" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    Inherits="Nivdal.AdministerPunishments"  StylesheetTheme="SkinFile"
    CodeBehind="AdministerPunishments.aspx.cs" %>

<asp:Content ID="PageNameContent" ContentPlaceHolderID="PageNamePlaceHolder" runat="server">
    <asp:Label ID="PageNameLabel" runat="server" Text="<%$ Resources:Resource, AdministerPunishments_PageNameLabel %>"
        CssClass="PageNameContentStyle"></asp:Label>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
        <div class="basic_element">
        <div class="red_title">
            <asp:Label ID="InappropriateBehaviourReportsTitle" runat="server" CssClass="white_title" Text="<%$ Resources:Resource, ThreadDetails_ReportImageButtonToolTip %>"></asp:Label>
        </div>
        <div class="padding5">
        <asp:Label ID="MessageLabel" runat="server" Text="" SkinID="GridLabel"></asp:Label>
        
        <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
            <ProgressTemplate>
                <div class="ajaxloader">
                    <asp:Image ID="ProgressImage" runat="server" ImageUrl="~/Images/ajax-loader.gif" />
                </div> 
            </ProgressTemplate>
        </asp:UpdateProgress>                    
               
        
        <br />
        <asp:GridView ID="InappropriateBehaviourReportsGridView" runat="server" DataSourceID="InappropriateBehaviourReportsSqlDataSource"
            SkinID="Professional" OnRowCommand="AdminAction" OnRowCreated="InappropriateBehaviourReportsGridView_OnRowCreated"
            AutoGenerateColumns="False" AllowPaging="True" EnableTheming="True">
            <PagerSettings FirstPageText="<%$ Resources:Resource, FirstPage %>" LastPageText="<%$ Resources:Resource, LastPage %>"
                Mode="NumericFirstLast" PageButtonCount="10" Position="Bottom" />
            <PagerStyle CssClass="pagination" HorizontalAlign="Center" />
            <EmptyDataTemplate>
                <asp:Label ID="NoReportsLabel" runat="server" SkinID="GridLabel" Text="<%$ Resources:Resource, UserPage_NoReportsTitle %>"></asp:Label>
            </EmptyDataTemplate>
            <Columns>
                <asp:BoundField DataField="ReportId" Visible="true" />
                <asp:TemplateField ItemStyle-Width="20%">
                    <ItemTemplate>
                        <asp:Label ID="DateLabel" runat="server" Text='<%# Eval("ReportDate", "Date: {0}") %>'
                            SkinID="GridLabel"></asp:Label>
                        <br />
                        <asp:Label ID="ReportedByLabel" runat="server" Text='<%$ Resources:Resource, Global_By %>'
                            SkinID="GridLabel"></asp:Label>
                        <asp:HyperLink ID="SubmitterNameHyperLink" runat="server" Text='<%# Eval("SubmitterName") %>'
                            NavigateUrl='<%# Eval("SubmitterId", "UserPage.aspx?Id={0}") %>' SkinID="GreenTitleHyperLink"></asp:HyperLink>
                        <br />
                        <asp:Label ID="AgainstLabel" runat="server" Text="<%$ Resources:Resource, AdministerPunishments_AgainstLabel %>"
                            SkinID="GridLabel"></asp:Label>
                        <asp:HyperLink ID="ReportedUserNameHyperLink" runat="server" Text='<%# Eval("ReportedUserName") %>'
                            NavigateUrl='<%# Eval("ReportedUserId", "UserPage.aspx?Id={0}") %>' SkinID="GreenTitleHyperLink"></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<%$ Resources:Resource, AdministerPunishments_ReportNote %>" ItemStyle-Width="20%" >
                    <ItemTemplate>
                        <asp:Label ID="ReportNoteLabel" runat="server" SkinID="GridLabel" Text='<%# Eval("ReportNote") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField ItemStyle-Width="30%">
                    <HeaderTemplate>
                        <asp:Label ID="ReportedPostTextTitleLabel" runat="server"
                         Text="<%$ Resources:Resource, AdministerPunishments_ReportedPostTextTitleLabel %>"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="ReportedPostTextLabel" runat="server" Text='<%# Eval("ReportedPostText") %>' SkinID="GridLabel"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField ItemStyle-Width="10%">
                    <ItemTemplate>
                        <asp:HyperLink ID="ReportedPostIdHyperLink" runat="server" Text="<%$ Resources:Resource, AdministerPunishments_ReportedPostIdHyperLink %>"
                            NavigateUrl='<%# Eval("ReportedPostThread", "ThreadDetails.aspx?ThreadId={0}&PostId="+Eval("ReportedPostId")) %>'
                            SkinID="BlackHyperLinkSkin" Target="_blank"></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <HeaderTemplate>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:DropDownList ID="ActionDropDownList" AppendDataBoundItems="true" DataSourceID="ActionSqlDataSource"
                            DataTextField="Description" DataValueField="ActionId" runat="server">
                        </asp:DropDownList>
                        <br />
                        <asp:LinkButton ID="SubmitActionLinkButton" runat="server" OnClientClick='<%# SubmitActionLinkButtonOnClientClick()%>'
                            CommandArgument="<%#((GridViewRow) Container).RowIndex %>" CommandName="Submit"
                            Text="Submit action" SkinID="GridLinkButton"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EmptyDataTemplate>
                <asp:Label ID="NothingLabel" runat="server" Text="<%$ Resources:Resource, AdministerPunishments_NothingLabel %>" SkinID="GridLabel"></asp:Label>
            </EmptyDataTemplate>
        </asp:GridView>
        <br />
        <hr />
        <br />
        <asp:Label ID="SpamMailsTitle" runat="server" SkinID="InfoLabel" Text="<%$ Resources:Resource, BigMaster_DisciplicaryReportsTitle %>"></asp:Label>
        <br />
        <asp:GridView ID="MailReportedSpamGridview" runat="server" SkinID="Professional" DataSourceID="SpamMailsDataSource" AutoGenerateColumns="false"
         AllowPaging="true" PageSize="20" OnRowCommand="TreatMailReport">
            <PagerSettings FirstPageText="<%$ Resources:Resource, FirstPage %>" LastPageText="<%$ Resources:Resource, LastPage %>"
                Mode="NumericFirstLast" PageButtonCount="10" Position="Bottom" />
            <PagerStyle CssClass="pagination" HorizontalAlign="Center" />
            <EmptyDataTemplate>
                <asp:Label ID="NoReportsLabel" runat="server" SkinID="GridLabel" Text="<%$ Resources:Resource, UserPage_NoReportsTitle %>"></asp:Label>
            </EmptyDataTemplate>
            <Columns>
                <asp:TemplateField ItemStyle-Width="10%" >
                    <ItemTemplate>
                        <asp:Label ID="DateLabel" runat="server" SkinID="GridLabel" Text='<%# Eval("Date") %>'></asp:Label>
                        <br />
                        <asp:Label ID="FromTitleLabel" runat="server" Text="<%$ Resources:Resource, Global_From %>" SkinID="InfoLabel"></asp:Label>
                        <asp:HyperLink ID="FromLink" runat="server" NavigateUrl='<%# "~/UserPage.aspx?Id=" + Eval("SenderId") %>' Text='<%# Eval("SenderName") %>' SkinID="GreenTitleHyperLink"></asp:HyperLink>
                        <br />
                        <asp:Label ID="ToTitleLabel" runat="server" Text="<%$ Resources:Resource, Global_To %>" SkinID="InfoLabel"></asp:Label>
                        <asp:Hyperlink ID="ToLink" runat="server" NavigateUrl='<%# "~/UserPage.aspx?Id=" + Eval("ReceiverId") %>' Text='<%# Eval("ReceiverName") %>' SkinID="GreenTitleHyperLink"></asp:Hyperlink>
                         
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<%$ Resources:Resource, MailMessage_PageTitle %>" ItemStyle-Width="25%">
                    <ItemTemplate>
                        <asp:Label ID="SubjectTitleLabel" runat="server" SkinID="InfoLabel" Text="<%$ Resources:Resource, Global_Subject %>"></asp:Label>
                        <asp:Hyperlink ID="MailLink" runat="server" SkinID="BlackHyperLinkSkin" 
                        NavigateUrl='<%# "~/MailMessage.aspx?MailId=" + Eval("MailId") %>' Text='<%# Eval("MailSubject") %>'></asp:Hyperlink>
                        <hr />
                        <asp:Label ID="BodyLabel" runat="server" SkinID="GridLabel" Text='<%# Eval("MailBody") %>'></asp:Label>      
                                    
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<%$ Resources:Resource, Mail_ReportNoteTitle %>" ItemStyle-Width="25%">
                    <ItemTemplate>
                        <asp:Label ID="NoteLabel" runat="server" Text='<%# Eval("SpamReportNoteByReceiver") %>' SkinID="GridLabel"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<%$ Resources:Resource, SuspiciousReports_PleaseChooseActionsText %>" ItemStyle-Width="40%">
                    <ItemTemplate>
                        <asp:HiddenField ID="MailIdHiddenField" runat="server" Value='<%# Eval("MailId") %>' />
                        <asp:CheckBox ID="MarkReportAsSpamCB" runat="server" Text="<%$ Resources:Resource, AdministerPunishments_MarkSpam %>" CssClass="NewsItemStyle" />
                        <br />
                        <asp:CheckBox ID="CreateReportCB" runat="server" Text="<%$ Resources:Resource, AdministerPunishments_CreateWarningReport %>" CssClass="NewsItemStyle" />
                        <br />
                        <asp:Label ID="ExplaneLabel" runat="server" Text="<%$ Resources:Resource, SuspiciousReports_PleaseDescribeYourDecisionText %>" SkinID="InfoLabel"></asp:Label>
                        <br />
                        <CustomControls:TextArea ID="ReportNoteText" runat="server" Width="200" Height="80" MaxLength="1000" TextMode="MultiLine" ></CustomControls:TextArea>
                        <br />
                        <asp:Button ID="SubmitButton" runat="server" CommandName="Submit" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" CssClass="GreenSmallButtonStyle"
                         Text="<%$ Resources:Resource, Global_Submit %>" />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        

        <asp:SqlDataSource ID="InappropriateBehaviourReportsSqlDataSource" runat="server"
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="Nivdal_GetListOfInappropriateBehaviourReports"
            SelectCommandType="StoredProcedure"></asp:SqlDataSource>
        <asp:SqlDataSource ID="ActionSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_GetForumReportActons" SelectCommandType="StoredProcedure">
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SpamMailsDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_GetMailSpamReportsForGM" SelectCommandType="StoredProcedure">
        </asp:SqlDataSource>
        </div>
        </div>


    </ContentTemplate>
    </asp:UpdatePanel>
    
</asp:Content>
